﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Quartz;
using NLog;
using System.Configuration;

namespace Zhuang.WindowsService.Jobs
{
    public class DefaultJob : IJob
    {
        private static Logger log = NLog.LogManager.GetCurrentClassLogger();

        public void Execute(JobExecutionContext context)
        {
            try
            {
                Test1();
                //ImportInfoService ims = new ImportInfoService();
                //ims.Import();
            }
            catch (Exception ex)
            {
                log.Error(ex.Message + Environment.NewLine + ex.StackTrace);
                JobExecutionException jobException = new JobExecutionException(ex);
                throw jobException;
            }

        }

        private void Test1()
        {
            string strSql = "update Sys_User set Name='abc' where UserId=100";
            SqlHelper.connectionString = ConfigurationManager.ConnectionStrings["ConnectionString"].ToString(); ;
            SqlHelper.ExecuteSql(strSql);
        }
    }
}
